function ber = keygen_BER(key1,key2)
%KEYGEN_BER 
%   计算等长序列不同的比列
ber = 0;
if length(key1) != length(key1)
    disp("数组不等长");
    ber = -1;
else
    for i = 1 : length(key1)
        ber = ber + xor(key1(i), key2(i));
    end
    ber = ber / length(key1);
end

end

